<table class="layui-hide layui-table" id="test"  lay-filter="test"></table>

<!--默认参数编辑-->
<script type="text/html" id="moCode">
    <div class="moCode">
        <form action="" class="layui-form edit_info">
            <input type="hidden" name="id" value="{{d.id}}">
        <div class="item">
            <span>Key</span>
            <span>Value</span>
        </div>
        <div class="myCodeBody">

            {{#  layui.each(d.list, function(index, item){ }}

            <div class="item">
                <input type="text" name="key"  placeholder="" autocomplete="off" class="layui-input myinput" value="{{ index }}">
                <input type="text" name="value"  placeholder="" autocomplete="off" class="layui-input myinput" value="{{ item }}">
                <button type="submit" lay-filter="newadd" lay-submit class="layui-btn layui-btn-xs myinput">新增一行</button>
                <button type="submit" lay-filter="deladd" lay-submit class="layui-btn layui-btn-xs myinput layui-btn-danger">删除</button>
            </div>

            {{#  }); }}

            {{#  if(d.list.length === 0){ }}
            <div class="item">
                <input type="text" name="key"  placeholder="" autocomplete="off" class="layui-input myinput" value="">
                <input type="text" name="value"  placeholder="" autocomplete="off" class="layui-input myinput" value="">
                <button type="submit" lay-filter="newadd" lay-submit class="layui-btn layui-btn-xs myinput">新增一行</button>
                <button type="submit" lay-filter="deladd" lay-submit class="layui-btn layui-btn-xs myinput layui-btn-danger">删除</button>
            </div>
            {{#  } }}
        </div>
            <button type="submit" lay-filter="savefield" lay-submit class="layui-btn myinput " style="float: right">保存</button>
        </form>
    </div>
</script>

<!-- 单行编辑菜单栏-->
<script type="text/html" id="apiListBar">
    <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="create">模块生成</a>
</script>

<!--批量编辑菜单栏-->
<!--    <script type="text/html" id="toolbarDemo">-->
<!--        <button class="layui-btn layui-btn-sm" lay-event="sync">同步数据库信息</button>-->
<!--        &lt;!&ndash;<button class="layui-btn layui-btn-sm" lay-event="export">批量导出</button>&ndash;&gt;-->
<!--    </script>-->

<!--checked单选框-->
<script type="text/html" id="switchTpl">
    <input type="checkbox" name="is_edit" value="{{d.id}}" data-value="1|0" lay-skin="switch" lay-text="正常|禁用" lay-filter="switchTpl" {{ d.is_edit == 1 ? 'checked' : '' }}>
</script>
<script type="text/html" id="switchTpl2">
    <input type="checkbox" name="show_list" value="{{d.id}}" data-value="1|0" lay-skin="switch" lay-text="显示|隐藏" lay-filter="switchTpl" {{ d.show_list == 1 ? 'checked' : '' }}>
</script>
<script type="text/html" id="switchTpl3">
    <input type="checkbox" name="is_time" value="{{d.id}}" data-value="1|0" lay-skin="switch" lay-text="是|否" lay-filter="switchTpl" {{ d.is_time == 1 ? 'checked' : '' }}>
</script>

<script type="text/html" id="selectTpl">
    <div class="layui-input-inline">

        <select name="field_type" id="{{ d.id }}" lay-filter="selectTpl" class="field_type">
            <option value="">请选择表单类型</option>
            {foreach name="fieldType" item="vo" key="key"}
            <option value="{$key}" {{ d.field_type == {$key} ? 'selected':'' }} >{$vo}</option>
            {/foreach}
        </select>

    </div>

</script>

<script type="text/html" id="showTips">
    <label id='test{{ d.field }}' onmouseenter="showTips('{{ d.field }}','field','type')" onmouseleave='closeTips();'> {{ d.field }} </label>
</script>

<style>
    /* 防止下拉框的下拉列表被隐藏---必须设置--- 此样式和表格的样式有冲突 如果表格列数太多 会出现错乱的情况 目前我的解决方法是忽略下拉框的美化渲染 <select lay-ignore> */
    .layui-table-cell {
        overflow: visible;
    }

    .layui-table-box {
        overflow: visible;
    }

    .layui-table-body {
        overflow: visible;
    }
    /* 设置下拉框的高度与表格单元相同 */
    td .layui-form-select{
        margin-top: -10px;
        margin-left: -15px;
        margin-right: -15px;
    }

    .layui-unselect
    {
        /*height: 30px;*/
        margin-top: 10px;
    }
.layui-select-title input{
    height: 30px;
}
    /* 默认值编辑 */
    .moCode{
        padding: 10px;
    }
    .moCode .item{
        display: flex;
        justify-content: space-between;
        font-size: 18px;
        border-bottom: 1px #eee solid;
        margin-bottom: 5px;
        align-items: center;
        padding-bottom: 5px;
    }
    .myinput{
        margin-top:0px;
        margin-right: 5px;
    }
    td{
        background-color: #fff;
    }
</style>